#include "stdafx.h"
#include "EnvSigSource.h"
#include "EnvSignals.h"

using namespace Base::Env;

EnvSigSource::EnvSigSource()
{
}

EnvSigSource::~EnvSigSource()
{
}

EnvSigSource*
EnvSigSource::get()
{
    static EnvSigSource theInstance;
    return &theInstance;
}

void
EnvSigSource::switchEnv(Environment* oldActiveEnv,
                        Environment*    activeEnv)
{
    EnvSignal sig;
    sig.m_oldActiveEnv = oldActiveEnv;
    sig.m_activeEnv    =    activeEnv;

    send(&sig);
}